package cn.flying.cloud.flow.audit.service;

import javax.annotation.Resource;

import org.springframework.context.annotation.Lazy;

import cn.flying.cloud.base.common.utils.Ft;
import cn.flying.cloud.base.common.vo.Rt;
import cn.flying.cloud.flow.core.service.ProcessManageService;
import cn.flying.cloud.flow.model.FlowAuditVo;
import cn.flying.cloud.flow.model.FlowTaskVo;

/**
 * @author: admin
 * @date: 2025年07月01日 00:03
 * @version: 1.0
 */
public abstract class BaseFlowAuditService {

    @Lazy // 这里采用懒加载，否则会有循环依赖问题
    @Resource
    protected ProcessManageService processManageService;

    protected Rt<?> completeTask(FlowTaskVo<?> taskVo) {
        FlowAuditVo auditVo = new FlowAuditVo();
        Ft.BeanCopier.copy(taskVo, auditVo);
        processManageService.completeTask(auditVo);
        return Rt.success("提交成功！");
    }
}
